/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package library.command;

import java.util.List;
import library.book.Book;
import library.control.ControlProvider;
import library.control.IControlBook;

/**
 *
 * @author MonStar
 */
public class OutputCommand implements ICommand {

    private final String OUTPUT = "output";

    @Override
    public String name() {
        return OUTPUT;
    }

    @Override
    public void execute(String... args) {
        List<IControlBook> listControlBook = ControlProvider.getControl().getListControlBook();
        for (IControlBook controlBook : listControlBook) {
            System.out.println(controlBook.getName() + ": ");
            List<Book> listBooks = controlBook.getListBooks();
            for (Book book : listBooks) {
                System.out.println(book);
            }
        }
    }
}
